$(function () {
    $('#approval_Reason').datagrid({
        data: [
            {f1: 'value11', f2: 'value12'}
        ]
    })
    $.get('/orderBill/queryInsuranceReturn',{},function (data) {
        if(data.insuranceInfoChange){
            alert(2)
            data['insuranceInfoChange.checknumber'] =data.insuranceInfoChange.checknumber
            data['insuranceInfoChange.applicationtype'] =data.insuranceInfoChange.applicationtype
            data['insuranceInfoChange.formula'] =data.insuranceInfoChange.formula
            data['insuranceInfoChange.approvalassign'] =data.insuranceInfoChange.approvalassign
            data['insuranceInfoChange.checkeffectivetime'] =data.insuranceInfoChange.checkeffectivetime
            $('#doubt_del').val(data.insuranceInfoChange.suspicioustransactions);
        }
        if(data.product){
            data['product.name'] = data.product.name;
            data['product.coveragePrice'] = data.product.coveragePrice;
            data['product.coveragePrice'] = data.product.coveragePrice;
            data['product.basicPrice'] = data.product.basicPrice;
            data['product.basicPrice'] = data.product.basicPrice;
            $("#devValue_spend").val(data.product.coveragePrice-data.product.coveragePrice)
            $("#devValue_get").val(data.product.basicPrice-data.product.basicPrice)
        }
        if(data.organization){
            data['organization.organizationName'] = data.organization.organizationName;
        }
        if(data.client){
            data['client.realName'] = data.client.realName;
        }
/*        if(data.clientcarinfo){
            data['clientcarinfo.carNumber'] = data.clientcarinfo.carNumber;
            data['clientcarinfo.driverYears'] = data.clientcarinfo.driverYears;
            data['clientcarinfo.foreignCar'] = data.clientcarinfo.foreignCar;
            data['clientcarinfo.hasCarNumber'] = data.clientcarinfo.hasCarNumber;
            data['clientcarinfo.newCar'] = data.clientcarinfo.newCar;
            data['clientcarinfo.transferTime'] = data.clientcarinfo.transferTime;
            data['clientcarinfo.workingArea'] = data.clientcarinfo.workingArea;
            data['clientcarinfo.workingNature'] = data.clientcarinfo.workingNature;
            data['clientcarinfo.formula'] = data.clientcarinfo.formula;
            data['clientcarinfo.workingArea'] = data.clientcarinfo.workingArea;
        }*/
        $('#insuranReturn_form').form('load',data);
    })
})
function spendCal(){
    var msg;
    var val = $('#queryData').val();
    $.get('/orderBill/querySpend',{insurancePolicyNumber:val},function (data) {
        $.messager.show({
            title:'保费计算',
            msg:'原保费:'+data+'   现保费'+data+'    变化'+(data-data),
            showType:'show',
            style:{
                right:'',
                top:document.body.scrollTop+document.documentElement.scrollTop,
                bottom:''
            }
        });
    })
}
